package com.qingyun.customview.hencode.practice1.views

import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View

class Practice1DrawArcView @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0,
) : View(context, attrs, defStyleAttr) {
    private val paint = android.graphics.Paint().apply {
        isAntiAlias = true
        color = Color.BLACK
        style = Paint.Style.FILL
    }
    override fun onDraw(canvas: Canvas) {
        super.onDraw(canvas)

        paint.style = Paint.Style.FILL
//        canvas.drawArc(100f,200f,200f,300f,0f,90f,true,paint)
//        canvas.drawArc(400f,200f,500f,300f,0f,90f,false,paint)
        canvas.drawArc(300f,300f,700f,500f,-110f,90f,true,paint)
        canvas.drawArc(300f,300f,700f,500f,20f,140f,false,paint)
        paint.style = Paint.Style.STROKE
        canvas.drawArc(300f,300f,700f,500f,180f,45f,false,paint)
    }
}